package com.dd.ljzapplication.activity;

import android.graphics.Color;
import android.util.TypedValue;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.dd.ljzapplication.R;

import base.BaseUtilActivity;

/**
 * Created by LiJZ on 2017/1/13.
 */

public class CustomViewActivity extends BaseUtilActivity{

	private Button mBtnQQ;
	private RelativeLayout mContentView;

	@Override
	protected int setLayoutID() {
		return R.layout.activity_custom_view;
	}

	@Override
	protected void init() {

	}

	@Override
	protected void initActionBar() {

	}

	@Override
	protected void initView() {
		mBtnQQ = (Button) findViewById(R.id.btn_qq);
		mContentView = (RelativeLayout) findViewById(R.id.content);
		TextView child1 = new TextView(this);
		child1.setText("123456789");
		child1.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 30);
		child1.setBackgroundColor(Color.RED);
		LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
				LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
		child1.setLayoutParams(params);
		mContentView.addView(child1, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, 0));
//		mContentView.addView(child1);
	}

	@Override
	protected void initEvent() {
		mBtnQQ.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {

			}
		});
	}
}
